package test;

import java.util.Scanner;

public class ThirdPathMN {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入m,n，要求1<=m,n<=100");
        int m=sc.nextInt();
        int n=sc.nextInt();
     if(m>=1&&m<=100&&n>=1&&n<=100){
         int carculate = carculate(m-1, n-1);
         System.out.println("路径共有 " + carculate);
     }else{
         System.out.println("输入有误");
     }

    }
    public static int carculate(int m,int n){
       if(m==1){
           return n+1;
       }else if(n==1){
           return m+1;
        }else{
           return carculate(m-1, n)+carculate(m,n-1);
       }
    }
}
